﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:CounterStrikeSourceAimbot_WpfControls"
	mc:Ignorable="d"
	x:Class="CounterStrikeSourceAimbot_WpfControls.MapControl"
	x:Name="UserControl" >

    <UserControl.Resources>
        <local:RadToDegConverter x:Key="RadToDegConverter"/>
    </UserControl.Resources>

    <Grid RenderTransformOrigin="0.5,0.5" >
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform Angle="{Binding WorldData.MainPlayerPitch, Converter={StaticResource RadToDegConverter}, ElementName=UserControl}"/>
                <TranslateTransform X="{Binding ElementName=WorldData.MainPlayerLocation}"/>
            </TransformGroup>
        </Grid.RenderTransform>

        <Image Source="Images/SemiTransparentBackground.png" Stretch="UniformToFill" Opacity="1" />

        <Canvas x:Name="MainCanvas" Margin="0" Width="{Binding ActualWidth, ElementName=image}" Height="{Binding ActualHeight, ElementName=image}">
            <Image x:Name="image" Source="Images/de_dust2.png"  Opacity="1" />
        </Canvas>
    </Grid>
</UserControl>